import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/task/process_exec_entity.dart';

ProcessExecEntity $ProcessExecEntityFromJson(Map<String, dynamic> json) {
  final ProcessExecEntity processExecEntity = ProcessExecEntity();
  final String? processCode = jsonConvert.convert<String>(json['processCode']);
  if (processCode != null) {
    processExecEntity.processCode = processCode;
  }
  final String? rtemplateId = jsonConvert.convert<String>(json['rtemplateId']);
  if (rtemplateId != null) {
    processExecEntity.rtemplateId = rtemplateId;
  }
  final String? rtemplateName = jsonConvert.convert<String>(json['rtemplateName']);
  if (rtemplateName != null) {
    processExecEntity.rtemplateName = rtemplateName;
  }
  final String? submitUser = jsonConvert.convert<String>(json['submitUser']);
  if (submitUser != null) {
    processExecEntity.submitUser = submitUser;
  }
  final String? submitUserId = jsonConvert.convert<String>(json['submitUserId']);
  if (submitUserId != null) {
    processExecEntity.submitUserId = submitUserId;
  }
  final String? templateTime = jsonConvert.convert<String>(json['templateTime']);
  if (templateTime != null) {
    processExecEntity.templateTime = templateTime;
  }
  return processExecEntity;
}

Map<String, dynamic> $ProcessExecEntityToJson(ProcessExecEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['processCode'] = entity.processCode;
  data['rtemplateId'] = entity.rtemplateId;
  data['rtemplateName'] = entity.rtemplateName;
  data['submitUser'] = entity.submitUser;
  data['submitUserId'] = entity.submitUserId;
  data['templateTime'] = entity.templateTime;
  return data;
}

extension ProcessExecEntityExtension on ProcessExecEntity {
  ProcessExecEntity copyWith({
    String? processCode,
    String? rtemplateId,
    String? rtemplateName,
    String? submitUser,
    String? submitUserId,
    String? templateTime,
  }) {
    return ProcessExecEntity()
      ..processCode = processCode ?? this.processCode
      ..rtemplateId = rtemplateId ?? this.rtemplateId
      ..rtemplateName = rtemplateName ?? this.rtemplateName
      ..submitUser = submitUser ?? this.submitUser
      ..submitUserId = submitUserId ?? this.submitUserId
      ..templateTime = templateTime ?? this.templateTime;
  }
}
